﻿
-- =============================================
-- Author:		Naresh N Jamadagni
-- Create date: 21 May 2012
-- Description:	Delets all the processes for specified computer
-- =============================================
CREATE PROCEDURE [dbo].[AddCPUUsageEntry]
(
			@ComputerId int,
            @Time datetime,
            @Value tinyint
           
)
AS

BEGIN
	SET NOCOUNT ON;
	IF NOT EXISTS( SELECT * FROM [dbo].[CPUUsage] WHERE [ComputerId] = @ComputerId AND [Time] = @Time)
	BEGIN
	   INSERT INTO [dbo].[CPUUsage]
			   ([ComputerId]
			   ,[Time]
			   ,[Value])
		 VALUES
			   (@ComputerId,
			   @Time,
			   @Value);
	END
END


